package com.wdm.sms.controller.token;

import com.wdm.sms.commonutil.utils.jwt.PassToken;
import com.wdm.sms.commonutil.utils.r.R;
import com.wdm.sms.entity.User;
import com.wdm.sms.service.token.impl.ITokenService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: wudaiming
 * @date: 2023/3/13
 * @version: 1.0
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("token")
public class TokenController {
    private final ITokenService iTokenService;

    @PostMapping("/getToken")
    @PassToken
    public R getToken(User user) {
        return iTokenService.getToken(user);
    }
}
